import ShaderBase from "../../../../shaders/shader_base";

const { executeInEditMode, ccclass, property } = cc._decorator;

@ccclass
@executeInEditMode
export default class ShaderHSB extends ShaderBase {
    @property({
        visible: false,
        serializable: true
    })
    _hVal = 0;

    @property
    get hVal() {
        return this._hVal;
    }
    set hVal(val) {
        this._hVal = val;
        this.refresh();
    }

    refresh() {
        if (!this.material) {
            cc.warn("OpacityMaskHelper::refresh, warn: this.material为空");
            return;
        }
        this.material.setProperty("hue", this.hVal);
    }
};